﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Pg.BioMedics.SDR.ServiceAgents.Configuration
{
    /// <summary>
    /// Represents mapping to service endpoint
    /// </summary>
    public class EndpointElement : ConfigurationElement
    {
        #region Constants

        private const string EndpointNameProperty = "endpointName";
        private const string EnabledProperty = "enabled";

        #endregion

        #region Properties

        /// <summary>
        /// Gets / sets endpoint name property
        /// </summary>
        [ConfigurationProperty(EndpointNameProperty)]
        public string EndpointName
        {
            get
            {
                return this[EndpointNameProperty] as string;
            }

            set
            {
                this[EndpointNameProperty] = value;
            }
        }

        /// <summary>
        /// Gets / sets value indicating if endpoint should be enabled or disabled
        /// </summary>
        [ConfigurationProperty(EnabledProperty)]
        [DefaultSettingValue("true")]
        public bool Enabled
        {
            get
            {
                return (bool)this[EnabledProperty];
            }

            set
            {
                this[EnabledProperty] = value;
            }
        }

        #endregion
    }
}
